package app.mvc.view.components.dragDrop
{
	import alternativa.gui.alternativagui;
	import alternativa.gui.base.ActiveObject;
	import alternativa.gui.base.GUIobject;
	import alternativa.gui.mouse.MouseManager;
	import alternativa.gui.mouse.dnd.IDragObject;
	import alternativa.gui.utils.MouseUtils;
	
	import app.mvc.Notifications;
	import app.mvc.model.VO.ControlsBarVO;
	import app.mvc.view.components.uiControls.UIObject;
	
	import flash.display.Bitmap;
	import flash.display.DisplayObject;
	import flash.geom.Point;
	
	import org.puremvc.as3.patterns.facade.Facade;
	import org.puremvc.as3.patterns.observer.Notification;
	
	import utils.UtilsGraphics;

	use namespace alternativagui;
	
	public class DraggingObject extends GUIobject implements IDragObject
	{
		private var _dataObject:Object;
		private var _draggingSnapShot:Bitmap;
		
		public function DraggingObject(displayObject:DisplayObject,dataObject:Object)
		{
			super();
			
			_dataObject = dataObject;
			_draggingSnapShot = new Bitmap(UtilsGraphics.getSnapShot(displayObject as DisplayObject));
			addChild(_draggingSnapShot);
			mouseChildren = mouseEnabled = false;
			
			if(_dataObject is ControlsBarVO || _dataObject is UIObject)
			{
				Facade.getInstance().sendNotification(Notifications.TO_ENABLE_DRAGGING_DETECTOR);
			}
		}
		
		public function get draggingSnapShot():Bitmap
		{

			return _draggingSnapShot;
		}

		public function get data():Object
		{
			// TODO Auto Generated method stub
			return _dataObject;
		}
		
		public function get graphicObject():DisplayObject
		{
			return this;
		}
	}
}